package com.study.flink.java.day04_async;

import com.study.flink.java.utils.FlinkUtilsDemo;
import org.apache.flink.api.common.serialization.SimpleStringSchema;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;

/**
 * 从mysql取数转换
 * 最后sink打印
 */
public class QueryActivityNameMain {

    public static void main(String[] args) throws Exception {
        DataStream<String> lines = FlinkUtilsDemo.createKafkaStream(args, new SimpleStringSchema());
        SingleOutputStreamOperator<ActivityBean> beans = lines.map(new DataToActivityBeanFunction());
        // 查询数据库，各种各样的信息不完整，根据各种维度把他们关联成一张大宽表，大宽表一落到HBase，ES中来快速查询，空间换时间的思想，实时的的ETL。
        // 数据来了，关联维度数据，实时ETL，供快速查询分析，
        beans.print();
        FlinkUtilsDemo.getEnv().execute("QueryActivityName");
    }


}
